package game.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import common.model.po.GRecipe;
import game.model.request.SearchRecipeRequest;
import game.model.vo.SearchRecipeVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 配方和原料的多对多关系Mapper接口
 *
 * @author 米泽鹏
 * @since 2022-02-26
 */
@Mapper
public interface GRecipeMapper extends BaseMapper<GRecipe> {

	/**
	 * 根据原料、产物、生产建筑搜索配方
	 *
	 * @param request SearchRecipeRequest
	 * @param page    Page<SearchRecipeVo>
	 * @return Page<SearchRecipeVo>
	 */
	Page<SearchRecipeVo> searchRecipe(Page<SearchRecipeVo> page, @Param("request") SearchRecipeRequest request);

	SearchRecipeVo getRecipeDetailById(@Param("recipeId") Long recipeId);

}
